package com.lc.user.express.app;

import com.zcx.helper.app.AppApplication;
import com.zcx.helper.app.AppPreferences;

/**
 * Created by zcx on 2015/5/26.
 */
public class MyPreferences extends AppPreferences {

    public final String USERNAME = "username";// 账户

    public final String UID = "uid";// 服务器返回uid

    public final String IS_FIRST = "is_first";// 是否第一次打开
    //
    public final String IS_LOGIN = "is_login";// 是否登陆

    public final String CITY = "city";//当前选择城市，默认定位城市

    public final String CITY_ID = "city_id";//当前选择城市id

    public final String CITY_LOCATION = "city_location";//当前定位城市

    public final String IS_SHOW_CITY_DIALOG = "is_show_city_dialog";//是否显示切换当前定位城市

    public final String NEW_NEWS = "has_news"; // 新消息

    public final String POINT = "point"; // 新消息





    public void saveRouteId(String routeID) {
        putString("routeID", routeID);
    }

    public String readRouteId() {

        return getString("routeID", "");

    }




    public MyPreferences(AppApplication context) {

        super(context, "express");

    }

    public void setPoint(String point) {

        putString(POINT, point);

    }

    public String getPoint() {

        return getString(POINT, "");

    }


    public void setUid(String uid) {

        putString(UID, uid);

    }

    public String getUid() {

        return getString(UID, "");

    }

    public void setUserName(String userName) {

        putString(USERNAME, userName);

    }

    public String getUserName() {

        return getString(USERNAME, "");

    }

    public boolean getIsLogin() {
        return getBoolean(IS_LOGIN, false);
    }

    public void setIsLogin(boolean isLogin) {
        putBoolean(IS_LOGIN, isLogin);
    }

    public void setIsFirst(boolean isFirst) {

        putBoolean(IS_FIRST, isFirst);

    }

    public boolean getIsFirst() {

        return getBoolean(IS_FIRST, true);

    }

    public void setCity(String city) {
        putString(CITY, city);
    }

    public String getCity() {

        return getString(CITY, "");

    }

    public void setCityId(String cityId) {
        putString(CITY_ID, cityId);
    }

    public String getCityId() {

        return getString(CITY_ID, "");

    }

    public String getCityLocation() {
        return getString(CITY_LOCATION, "");
    }

    public void setCityLocation(String city) {
        putString(CITY_LOCATION, city);
    }

    public void setIsShowCityDialog(boolean is) {
        putBoolean(IS_SHOW_CITY_DIALOG, is);
    }

    public boolean getIsShowCityDialog() {

        return getBoolean(IS_SHOW_CITY_DIALOG, true);

    }

//    public void putHasNews(boolean hasNews) {
//        putBoolean(NEW_NEWS + getUid(), hasNews);
//    }
//
//    public boolean getHasNews() {
//        return getBoolean(NEW_NEWS + getUid(), false);
//    }

}
